//モバイル端末か判定 via https://w3g.jp/blog/tools/js_browser_sniffing var _ua = (function(){ return { ltIE6:typeof window.addEventListener == "undefined" && typeof document.documentElement.style.maxHeight == "undefined", ltIE7:typeof window.addEventListener == "undefined" && typeof document.querySelectorAll == "undefined", ltIE8:typeof window.addEventListener == "undefined" && typeof document.getElementsByClassName == "undefined", ltIE9:document.uniqueID && typeof window.matchMedia == "undefined", gtIE10:document.uniqueID && window.matchMedia, Trident:document.uniqueID, Gecko:'MozAppearance' in document.documentElement.style, Presto:window.opera, Blink:window.chrome, Webkit:typeof window.chrome == "undefined" && 'WebkitAppearance' in document.documentElement.style, Touch:typeof document.ontouchstart != "undefined", Mobile:typeof window.orientation != "undefined", ltAd4_4:typeof window.orientation != "undefined" && typeof(EventSource) == "undefined", Pointer:window.navigator.pointerEnabled, MSPoniter:window.navigator.msPointerEnabled } })(); if (_ua.Mobile) { $("body").addClass("mobile"); } // 念のためタッチデバイスで、992px未満のデバイスもモバイル扱いする if (typeof window.orientation != "undefined" || $(window).width() < 992) { $("body").addClass("mobile"); } /* * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ * * Uses the built in easing capabilities added In jQuery 1.1 * to offer multiple easing options * * TERMS OF USE - EASING EQUATIONS * * Open source under the BSD License. * * Copyright A?Ac 2001 Robert Penner * All rights reserved. * * TERMS OF USE - jQuery Easing * * Open source under the BSD License. * * Copyright A?Ac 2008 George McGinley Smith * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of the author nor the names of contributors may be used to endorse * or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * */ jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g 100) { topBtn.fadeIn(); } else { topBtn.fadeOut(); } }); //スクロールしてトップ topBtn.on('click',function (e) { e.preventDefault(); $('body,html').animate({scrollTop: 0}, 1000,'easeInOutQuart'); return false; }); //ブログページに最新記事のリストを表示 //feedは jimdo.com でないとダメみたいです www.cure-ph.co.jp だとCallbackでnullになる // if ($(window).width() < 768) { $(".cc-page-blog #content_area").after('
最近のお知らせ
'); moment.locale('ja'); $('#recent-blog-entry-list').feeds({ feeds : { // feed1: 'http://cure-ph.jimdo.com/rss/blog' feed1: 'https://www.cure-ph.co.jp/rss/blog' }, max:5, preprocess : function(feed) { // Using moment.js to diplay dates as time ago this.publishedDate = moment(this.publishedDate).format('LL');; }, entryTemplate : '
  • ' }); // } //画像サイズの固定を抑制 $(".cc-m-image-align-1, .cc-m-image-align-1 img, .cc-m-image-align-2, .cc-m-image-align-2 img, .cc-m-image-align-3, .cc-m-image-align-3 img, .j-gallery .thumb_sq3, .j-gallery .thumb_pro3, .j-gallery .innerthumbnail, .j-gallery .innerthumbnail img, .j-gallery .ccgalerie img").css("width","auto").css("height","auto"); $(".j-gallery .innerthumbnail img, .j-gallery .ccgalerie img").prop("width","auto").prop("height","auto"); //フォームをBootstrap仕様にする $("input[type='text'],input[type='email'],textarea,select").addClass("form-control"); $("input[type='submit']").addClass("btn btn-primary btn-lg btn-block"); // via [jQuery] ページを離れる際に確認メッセージを出す方法 http://www.18th-technote.com/?p=1447 を修正 // フォームの入力欄が更新されたかどうかを表すフラグです。 var isChanged = false; $(window).on("beforeunload", function() { if (isChanged) { // isChangedフラグがtrueの場合、つまり入力内容が変更されていた // 場合のみ文字列を返すようにします。 return "このページを離れようとしています。"; } }); // フォーム送信ボタンを最初は送信禁止にして、言葉を変更する if ($("form.cc-m-form").is(":has('.cc-m-required')")) { $("form.cc-m-form input[type='submit']").prop("disabled",true).val("未入力の項目があります"); } $("form.cc-m-form input, form.cc-m-form select, form.cc-m-form textarea").on("keyup change",function() { //必須項目が入力されていないとsubmitできないように var Required_text_empty_flag = 0; for (var i=0; i< $("form.cc-m-form .cc-m-required input:not([type='checkbox'])").length; i++) { if ($("form.cc-m-form .cc-m-required input:not([type='checkbox'])").eq(i).val().length == 0) { Required_text_empty_flag += 1; } } for (var i=0; i< $("form.cc-m-form input[type='checkbox']:checked").length; i++) { if ($("form.cc-m-form input[type='checkbox']:checked").eq(i).val().length == 0) { Required_text_empty_flag += 1; } } for (var i=0; i< $("form.cc-m-form input[type='radio']:checked").length; i++) { if ($("form.cc-m-form input[type='radio']:checked").eq(i).val().length == 0) { Required_text_empty_flag += 1; } } for (var i=0; i< $("form.cc-m-form .cc-m-required textarea").length; i++) { if ($("form.cc-m-form .cc-m-required textarea").eq(i).val().length == 0) { Required_text_empty_flag += 1; } } if (Required_text_empty_flag == 0) { $("form.cc-m-form input[type='submit']").prop("disabled",false).val("入力した情報を送信する"); } else { $("form.cc-m-form input[type='submit']").prop("disabled",true).val("未入力の項目があります"); } // 入力内容が更新されている場合は、isChangedフラグをtrueにします。 // ただし、DEL・BSキーで文字を削除して、 // またはチェックボックスを外して全て空欄の場合もあるので、 // フォームにある文字数をチェックします。 // keypress keydownではDEL・BSキーを押した後の状態を判定できないのでkeyupを使います。 // keyupだけだとチェックボックスをマウスでクリックした時に判定できないのでchangeも追加します。 var text_num = 0; for (var i=0; i< $("form.cc-m-form input[type='text']").length; i++) { text_num += $("form.cc-m-form input[type='text']").eq(i).val().length; } for (var i=0; i< $("form.cc-m-form input[type='email']").length; i++) { text_num += $("form.cc-m-form input[type='email']").eq(i).val().length; } for (var i=0; i< $("form.cc-m-form input[type='number']").length; i++) { text_num += $("form.cc-m-form input[type='number']").eq(i).val().length; } for (var i=0; i< $("form.cc-m-form input[type='tel']").length; i++) { text_num += $("form.cc-m-form input[type='tel']").eq(i).val().length; } for (var i=0; i< $("form.cc-m-form input[type='checkbox']:checked").length; i++) { text_num += $("form.cc-m-form input[type='checkbox']:checked").eq(i).val().length; } for (var i=0; i< $("form.cc-m-form textarea").length; i++) { text_num += $("form.cc-m-form textarea").eq(i).val().length; } if (text_num > 0 ) { isChanged = true; } else { isChanged = false; } }); $("form.cc-m-form [type='submit']").on("click",function() { // フォームをサブミットする前にフラグを落とします。 // ※ これをやらないと、サブミット時に確認メッセージが表示されてしまいます。 isChanged = false; }); //モーダルウインドウで動画の再生/停止 $('#message-video-2').on('shown.bs.modal',function(e){ // document.getElementById("message-video-2-contents").play(); $("#message-video-2-contents").get(0).play(); }); $('#message-video-2').on('hide.bs.modal',function(e){ // document.getElementById("message-video-2-contents").pause(); $("#message-video-2-contents").get(0).pause(); }); //モバイル版だけ if ($("body").hasClass("mobile")) { //メニューにお知らせ一覧を追加 if ($(window).width() < 768) { $("#header .navbar .cc-nav-level-0 > li:last-child").after(''); if (($("link[rel='canonical']").prop("href").match(/\/%E3%81%8A%E7%9F%A5%E3%82%89%E3%81%9B%E4%B8%80%E8%A6%A7\//i)) || ($("link[rel='canonical']").prop("href").match(/\/\d+\/\d+\/\d+\//i))) { $("#nav-go-to-blog, #nav-go-to-blog a").addClass("cc-nav-current"); } } //電話番号にリンクを付ける $(".for-call").each(function(){ $(this).wrap(''); }) //店舗一覧で改行 $("#page-2098614888 .shop-list dt + dd").each(function(){ $(this).html($(this).html().replace(/(〒.{9})/i,'$1
    ')) }); //誤タッチによる外部サイトが開くのを抑制する $("#sidebar a").on('click',function(){ if(!(window.confirm("外部サイトを開きますがよろしいですか?"))) return false; }); $(".shop-google-static-map a").on('click',function(){ if(!(window.confirm("マップを外部サイト・アプリで開きますがよろしいですか?"))) return false; }); //タッチしたときに背景色を変更する(iOS対策) if(_ua.Webkit){ $(".blogselection .j-blogarticle h1 a").each(function(){ $(this).on("touchstart",function(){ $(this).css("background-color","#dff0d8"); }); }); $("#footer .pagelist a").each(function(){ $(this).on("touchstart",function(){ $(this).css("background-color","rgba(255,255,255,0.25)"); }); }); } } else { // デスクトップ版では店舗のページにQRコードを追加 if ($("link[rel='canonical']").prop("href").match(/\/%E5%BA%97%E8%88%97%E4%B8%80%E8%A6%A7\/.+/i)) { $(".j-googlemaps, .shop-google-static-map").each(function(){ var qr_html = '

    このページのQRコード

    '; qr_html += '

    QRコード

    '; qr_html += '

    スマートフォンのQRコードリーダーアプリで取り込むことで、このページにすぐにアクセスできます。

    '; $(this).after(qr_html); }); } } });